package com.dobby.logger.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by lgq on 2015/5/13.
 */
public class DateFormatUtils {

    public static final String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss";

    public static  final String SOLR_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";

    public static String getSolrFormatStr(Date date) {
        DateFormat df = new SimpleDateFormat(SOLR_DATE_FORMAT);
        return df.format(date);
    }

    public static String getDefaultFormat(Date date) {
        DateFormat df = new SimpleDateFormat(DEFAULT_FORMAT);
        return df.format(date);
    }

}
